.class Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;
.super Landroid/widget/BaseAdapter;
.source "DownloadDialog.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/brixd/niceapp/activity/fragment/DownloadDialog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "GridAdapter"
.end annotation


# instance fields
.field private mContext:Landroid/content/Context;

.field private mDownloadItems:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;",
            ">;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;


# direct methods
.method public constructor <init>(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;Landroid/content/Context;Ljava/util/List;)V
    .registers 4
    .param p2, "context"    # Landroid/content/Context;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 221
    .local p3, "downloadItems":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;>;"
    iput-object p1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->this$0:Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 222
    iput-object p2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->mContext:Landroid/content/Context;

    .line 223
    iput-object p3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->mDownloadItems:Ljava/util/List;

    .line 224
    return-void
.end method


# virtual methods
.method public getCount()I
    .registers 2

    .prologue
    .line 228
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->mDownloadItems:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .registers 3
    .param p1, "position"    # I

    .prologue
    .line 233
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->mDownloadItems:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .registers 4
    .param p1, "position"    # I

    .prologue
    .line 238
    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .registers 8
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    const/4 v3, -0x2

    .line 243
    if-nez p2, :cond_13

    .line 244
    new-instance v0, Landroid/widget/ImageButton;

    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->mContext:Landroid/content/Context;

    invoke-direct {v0, v2}, Landroid/widget/ImageButton;-><init>(Landroid/content/Context;)V

    .line 245
    .local v0, "imageButton":Landroid/widget/ImageButton;
    new-instance v2, Landroid/widget/AbsListView$LayoutParams;

    invoke-direct {v2, v3, v3}, Landroid/widget/AbsListView$LayoutParams;-><init>(II)V

    invoke-virtual {v0, v2}, Landroid/widget/ImageButton;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 247
    move-object p2, v0

    .line 250
    .end local v0    # "imageButton":Landroid/widget/ImageButton;
    :cond_13
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->mDownloadItems:Ljava/util/List;

    invoke-interface {v2, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    .line 252
    .local v1, "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;->mDownloadItems:Ljava/util/List;

    invoke-interface {v2, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    iget v2, v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->bgResId:I

    invoke-virtual {p2, v2}, Landroid/view/View;->setBackgroundResource(I)V

    .line 253
    new-instance v2, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;

    invoke-direct {v2, p0, v1}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter$1;-><init>(Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;)V

    invoke-virtual {p2, v2}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 311
    return-object p2
.end method
